import { moduleRequest } from "./axios";

const GET_URL = "list";
const ADD_URL = "add";
const EDIT_URL = "edit";
const DELETE_URL = "delete";
const BATCH_UPDATE_URL = "batchUpdate";

export type Cate = {
  name: string;
  iconClass: string;
  icon: string;
  orderSotr?: number;
  id?: string;
  
};

export type ResData = {
  countId: number | null;
  current: number;
  maxLimit: number | null;
  optimizeCountSql: boolean;
  orders: [];
  pages: number;
  records: Cate[];
  searchcount: boolean;
  size: number;
  total: number;
};

const request = moduleRequest(`/biz/portaluserpage/`);
export default {
  get() {
    return request(GET_URL, undefined, "get");
  },
  add(data: Cate) {
    return request(ADD_URL, data, "post");
  },
  edit(data: Cate) {
    return request(EDIT_URL, data, "post");
  },
  delete(data) {
    return request(DELETE_URL, data, "post");
  },
  batchUpdate(data) {
    return request(BATCH_UPDATE_URL, data, "post");
  },
};
